package demo;

import java.util.StringTokenizer;
import com.amarsoft.dexpre.ResourceConfig;
import com.amarsoft.dexpre.bean.Transaction;
import com.amarsoft.dexpre.parser.ServerDataParser;

public class Demo4DataParser extends ServerDataParser {
	
	protected Transaction createTransaction(Object receivedData) throws Exception{
		Transaction trans = null;
		String messStr = null;
		if(receivedData instanceof byte[])
			messStr = new String((byte[])receivedData);
		else
			messStr = (String)receivedData;
		String delimiter = "|";
		StringTokenizer st = new StringTokenizer(messStr, delimiter);
		String serviceCode = String.valueOf(st.nextElement());
		trans = ResourceConfig.getTransactionByServiceCode(serviceCode, deployID);
		return trans;
	}
	
}
